package util

import (
	"github.com/astaxie/beego"
	ypClient "github.com/yunpian/yunpian-go-sdk/sdk"
	"strconv"
)

// 发送验证码
func SendSMS(mobile string, code int) *ypClient.Result {
	clnt := ypClient.New(beego.AppConfig.String("yunpianapikey"))
	param := ypClient.NewParam(2)
	param[ypClient.MOBILE] = mobile
	param[ypClient.TEXT] = "【Moxyu】您的验证码是" + strconv.Itoa(code) + "。如非本人操作，请忽略本短信"
	return clnt.Sms().SingleSend(param)
}
